/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bayu.services.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Bayu
 */
@Entity
@Table(name = "stock")
@NamedQueries({@NamedQuery(name = "Stock.findAll", query = "SELECT s FROM Stock s"), @NamedQuery(name = "Stock.findById", query = "SELECT s FROM Stock s WHERE s.id = :id"), @NamedQuery(name = "Stock.findByDate", query = "SELECT s FROM Stock s WHERE s.date = :date"), @NamedQuery(name = "Stock.findByPlanincoming", query = "SELECT s FROM Stock s WHERE s.planincoming = :planincoming"), @NamedQuery(name = "Stock.findByIncoming", query = "SELECT s FROM Stock s WHERE s.incoming = :incoming"), @NamedQuery(name = "Stock.findByPlanusage", query = "SELECT s FROM Stock s WHERE s.planusage = :planusage"), @NamedQuery(name = "Stock.findByUsagedata", query = "SELECT s FROM Stock s WHERE s.usagedata = :usagedata")})
public class Stock implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Long id;
    @Basic()
    @Column(name = "date")
    @Temporal(TemporalType.DATE)
    private Date date;
    @Basic(optional = false)
    @Column(name = "planincoming")
    private double planincoming;
    @Basic(optional = false)
    @Column(name = "incoming")
    private double incoming;
    @Basic(optional = false)
    @Column(name = "planusage")
    private double planusage;
    @Basic(optional = false)
    @Column(name = "usagedata")
    private double usagedata;

    public Stock() {
    }

    public Stock(Long id) {
        this.id = id;
    }

    public Stock(Long id, Date date, double planincoming, double incoming, double planusage, double usagedata) {
        this.id = id;
        this.date = date;
        this.planincoming = planincoming;
        this.incoming = incoming;
        this.planusage = planusage;
        this.usagedata = usagedata;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public double getPlanincoming() {
        return planincoming;
    }

    public void setPlanincoming(double planincoming) {
        this.planincoming = planincoming;
    }

    public double getIncoming() {
        return incoming;
    }

    public void setIncoming(double incoming) {
        this.incoming = incoming;
    }

    public double getPlanusage() {
        return planusage;
    }

    public void setPlanusage(double planusage) {
        this.planusage = planusage;
    }

    public double getUsagedata() {
        return usagedata;
    }

    public void setUsagedata(double usagedata) {
        this.usagedata = usagedata;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Stock)) {
            return false;
        }
        Stock other = (Stock) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bayu.services.entity.Stock[id=" + id + "]";
    }

}
